package com.mashiro.system.controller;

import com.mashiro.common.core.controller.BaseController;
import com.mashiro.common.core.page.TableDataInfo;
import com.mashiro.system.domain.data.ProjectData;
import com.mashiro.system.domain.data.ProjectFundData;
import com.mashiro.system.domain.data.ProjectInitAndFinishData;
import com.mashiro.system.domain.data.ProjectTypeData;
import com.mashiro.system.service.IMoeProjectService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 数据图表Controller
 *
 * @author mashiro
 * @date 2023-04-30
 */
@RestController
@RequestMapping("/system/data")
public class MoeDataDiagramController extends BaseController {
    @Resource
    private IMoeProjectService moeProjectService;

    @GetMapping("/projectTypeData")
    public TableDataInfo getProjectTypeData(){
        List<ProjectTypeData> projectTypeData = moeProjectService.getMoeProjectTypeData();
        return getDataTable(projectTypeData);
    }

    @GetMapping("/projectData")
    public TableDataInfo getProjectData(){
        List<ProjectData> projectData = moeProjectService.getMoeProjectData();
        return getDataTable(projectData);
    }

    @GetMapping("/projectFundData")
    public TableDataInfo projectFundData(){
        List<ProjectFundData> projectData = moeProjectService.getProjectFundData();
        return getDataTable(projectData);
    }

    @GetMapping("/projectInitAndFinishData")
    public TableDataInfo projectInitAndFinishData(){
        List<ProjectInitAndFinishData> projectData = moeProjectService.getProjectInitAndFinishData();
        return getDataTable(projectData);
    }
}
